"""
功能描述 ：
编写人 ：
编写日期 ：
实现逻辑 ：
    1- ......
        1.1- ......
    2- ......
        2.1- ......
"""
import requests
#定义类
class ConfigHttp():
    def __init__(self,m,u,v):
        self.method = m
        self.url = u
        self.value = v

    # 定义一个对外方法:run
    def run(self):
        if self.method == 'get':
            re = self.__get()
            return re
        elif self.method == 'post':
            re = self.__post()
            return re
    # 进行get请求,并返回结果
    def __get(self):
        re = requests.get(url=self.url,params=self.value)
        return re
    def __post(self):
        re = requests.post(url=self.url,data=self.value)
        return re

if __name__ == '__main__':
    """https://www.wanandroid.com/user/login post {'username': 'chenyusong', 'password': 'Cys877803+'} 0"""
    method = "post"
    url = "https://www.wanandroid.com/user/login"
    value =  {'username': 'chenyusong', 'password': 'Cys877803+'}
    #实例化
    ch = ConfigHttp(method, url, value)
    re = ch.run()
    print(re.text)